/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.iss.examsys.view;

import com.iss.examsys.entity.User;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Named;

/**
 *
 * @author User
 */
@ApplicationScoped
@Named
public class InvigilateExamView {
    
    private ArrayList<User> loggedOnUsers = new ArrayList<User>();
    
    private HashMap<String,Integer> studentAnsweredQuestion = new HashMap<String,Integer>();
    
    private HashMap<String,Boolean> studentSubmissionStatus = new HashMap<String,Boolean>();
    
    public void updateLoggedOnUsers(User user){
        if(!loggedOnUsers.contains(user)){
            loggedOnUsers.add(user);
        }
    }
    
    public void updateStudentExamStatus(String userId,int questionAnswered){
        studentAnsweredQuestion.put(userId, questionAnswered);
    }
    
    public void updateStudentSubmissionStatus(String userId,boolean completed){
        studentSubmissionStatus.put(userId, completed);
    }
    
}
